<template>
	<div id = "container">
		<el-form label-width = "120px">
			<el-form-item label = "姓名">
				<el-input v-model="tea.teaName">
					
				</el-input>
			</el-form-item>
			<el-form-item label = "性别">
				<el-radio-group v-model="tea.teaSex">
					<el-radio label = "1">男</el-radio>
					<el-radio label = "2">女</el-radio>
				</el-radio-group>
			</el-form-item>
			<el-form-item>
				<el-button @click="reg()">添加</el-button>
			</el-form-item>
		</el-form>
	</div>
</template>

<script>
	export default{
		name:"TeaAddView",
		data(){
			return{
				tea:{
					teaName:'',
					teaSex:''
				}
			}
		},
		methods:{
			reg(){
				this.$axios.post("http://localhost:9001/tea/reg", this.tea)
				.then(rst=>{
					if(rst.data.code==200){
						this.$alert("教师添加成功","提示")
					}
					else{
						this.$alert("教师添加失败","提示")
					}
				})
			}
		}
	}
</script>

<style>
</style>
